﻿package code
{
	
	public class SugarCubeMine extends GenericEnemy
	{
		var gun:EnemyWeapon;
		// the amount/direction to increment rotation by
		var rotateVal:int; // this shoudl be handled in GameObject
		var rotationMag:int = 5; // this shoudl be handled in GameObject

		public function SugarCubeMine(scrollFactor:int, spawnX:int, spawnY:int)
		{
			//trace(this + "was created");
			super(spawnX, spawnY, 100);
			this.scaleX = this.scaleY = .5;
			this.trigger();
			this.vy = scrollFactor;
			
			this.rotation = Math.floor(Math.random()*360);
			rotateVal = ( Math.random() < .5 ? -rotationMag : rotationMag );
			
			stop();
			
			//gun = new EnemyWeapon(0, this.width / 2, 3, 500, 1500);
			//this.addChild(gun);
		}
		
		public override function update():void
		{
			this.rotation += rotateVal;
			//rotateVal *= -1;
			super.update();
			//gun.update();
		}

	}
}